home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #4 / Amiga Plus CD - 2000 - No. 4.iso / Tools / Grafik / Misc / ImageEnginer / ARexx / Fresco.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1996-11-11  |  1.7 KB  |  84 lines

  1. /* 
  2. ** $VER: Fresco 1.0, IE Arexx script
  3. ** Image Engineer Macro script
  4. ** © by Patrik M Nydensten 
  5. ** 10/11 1996 Stockholm/Sweden
  6. **
  7. ** Builds a fresco version of primary image.
  8. ** Similar to the ADPro fresco script.
  9. */
  10.  
  11. Options results
  12. Signal on error            /* Setup a place for errors to go */
  13.  
  14. if arg()==0 then exit
  15.  
  16. med_vals = '3 3'
  17.  
  18. Image1 = disperse(arg(1),1)
  19.  
  20. 'MEDIAN' Image1 med_vals
  21. Image2 = Result
  22. 'CLOSE' Image1
  23.  
  24. Image3 = disperse(Image2,1)
  25. 'CLOSE' Image2
  26.  
  27. 'MEDIAN' Image3 med_vals
  28. Image4 = Result
  29. 'CLOSE' Image3
  30.  
  31. Image5 = disperse(Image4,2)
  32. 'CLOSE' Image4
  33.  
  34. 'MEDIAN' Image5 med_vals
  35. Image6 = Result
  36. 'CLOSE' Image5
  37.  
  38. 'CONVOLVE' Image6 '"IE:Convolves/WoodCut"'
  39. OutputImage = Result
  40. 'CLOSE' Image6
  41.  
  42. exit
  43.  
  44. /* Procedures */
  45.  
  46. disperse:
  47.   parse arg in_image,distance
  48.     'NOISE' in_image '100 INTENSITY RANDOM'
  49.     noise1=Result
  50.     'MARK' noise1 'ALPHA'
  51.     'MARK' in_image 'PRIMARY'
  52.     'DISPLACE' distance '0 BEST'
  53.     disp1=Result
  54.     'CLOSE' noise1
  55.     
  56.     'NOISE' in_image '100 INTENSITY RANDOM'
  57.     noise2=RESULT
  58.     'MARK' noise2 'ALPHA'
  59.     'MARK' disp1 'PRIMARY'
  60.     'DISPLACE 0' distance 'BEST'
  61.   disp2=Result
  62.     'CLOSE' noise2
  63.     'CLOSE' disp1
  64.  
  65. return strip(disp2)
  66.  
  67. /*******************************************************************/
  68. /* This is where control goes when an error code is returned by IE */
  69. /* It puts up a message saying what happened and on which line     */
  70. /*******************************************************************/
  71. error:
  72. if RC=5 then do            /* Did the user just cancel us? */
  73.     IE_TO_FRONT
  74.     LAST_ERROR
  75.     'REQUEST "'||RESULT||'"'
  76.     exit
  77. end
  78. else do
  79.     IE_TO_FRONT
  80.     LAST_ERROR
  81.     'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' 'Doh!'
  82.     exit
  83. end
  84.